package com.ZeroCarbon.controller;

import com.ZeroCarbon.utils.FileHandingUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 文件获取控制器
 *
 * @since 2025-2-24
 */
@RestController
@RequestMapping("/general")
public class FileAcquisitionController {

    @GetMapping("/getFile")
    public void getFile(@RequestParam String realFilePath, HttpServletResponse response) throws IOException {
        //下载文件
        FileHandingUtils.getFile(realFilePath, response);
    }
}
